<?php

class TestAction extends Action
{
    public function index()
	{
		header("Content-Type:text/html; charset=utf-8");
				
		echo U('Index/index?id=0');
		//echo date('Y-m-01', strtotime('2012-2')); 
		//echo date('Y-m-d', strtotime(date('Y-m-01', strtotime('2012-2')).'+1 month -1 day')); 
		/*
		$zip = new ZipArchive;//新建一个ZipArchive的对象
		
		通过ZipArchive的对象处理zip文件
		$zip->open这个方法的参数表示处理的zip文件名。
		如果对zip文件对象操作成功，$zip->open这个方法会返回TRUE
		覆盖解压
		
		if ($zip->open(C('APP_PATH_DIY').'/test.zip') === TRUE)
		{
			$zip->extractTo(C('APP_PATH_DIY').'/TEST');//假设解压缩到在当前路径下TEST
			$zip->close();//关闭处理的zip文件
			echo '操作已完成'.date('Y-m-d H:i:s');
		}
		else
		{
			echo '没有找到压缩档案';
		}
		*/
		//C('SHOW_PAGE_TRACE',true);
		//$this->display('index');
        $total_dr_curr = 110227.2;
        $total_cr_curr = 110227.2;
        $total_dr = 110227.2;
        $total_cr = 110227.2;
        if((double)$total_dr_curr!=(double)$total_cr_curr || (double)$total_dr!=(double)$total_cr)
		{
				echo "借贷不平衡!($total_dr_curr-->$total_cr_curr)  ($total_dr-->$total_cr)";
		}else{
                echo "平衡";
        }
	}
	
	public function show_misone_info()
	{
		header("Content-Type:text/html; charset=utf-8");
		if( $_REQUEST['auth'] == 'misone')
		{
			
			if( $_REQUEST['request_code'])
			{
				$info0['code']=md5('check_system');			
				$info0['html']=md5($_REQUEST['request_code'].md5(C('REGISTER_PASS')).md5(C('REGISTER_VER')));
				$info0['desc']=$_REQUEST['request_code'];
				var_dump($info0);
			}
			
			vendor('MisoneAction.misone#action');
			$mac = new GetMacAddr(PHP_OS);
			$reginfo = $mac->mac_addr;
		
			$info1['code']=md5('check_system');			
			$info1['html']=md5($reginfo.md5(C('REGISTER_PASS')).md5(C('REGISTER_VER')));
			$info1['desc']=$reginfo;
			var_dump($info1);
			
			$checkfile = C('APP_PATH_DIY').'/web_config_diy.php';
			
			$info2['code']=md5('web_config');
			$info2['html']=md5(md5_file($checkfile));
			$info2['desc']='web_config';
			var_dump($info2);
			
			$checkfile = C('APP_PATH_DIY').'/Erp/Tpl/Index/index.html';
			$info3['code']=md5('index');
			$info3['html']=md5(md5_file($checkfile));
			$info3['desc']='index';
			var_dump($info3);
			
			$checkfile = C('APP_PATH_DIY').'/Erp/Tpl/Public/login.html';
			$info4['code']=md5('login');
			$info4['html']=md5(md5_file($checkfile));
			$info4['desc']='login';
			var_dump($info4);
			
			$checkfile = C('APP_PATH_DIY').'/Erp/Tpl/Public/menubar.html';
			$info5['code']=md5('menubar');
			$info5['html']=md5(md5_file($checkfile));
			$info5['desc']='menubar';
			var_dump($info5);
		}
	}
    
    public function show_sign_code()
	{
		header("Content-Type:text/html; charset=utf-8");
		if( $_REQUEST['auth'] == 'misone')
		{
            echo md5(md5(date('Y-m-d').'-misone'));
        }
    }
}
?>